from flask import Flask, g, render_template, make_response, request
from pymongo import MongoClient


MONGO_DB_IP = "127.0.0.1"
MONGO_DB_PORT = "27017"
app = Flask(__name__)
app.config.from_object(__name__)

@app.before_request
def mongodb_conn():
	g.mongo_client = MongoClient(app.config["MONGO_DB_IP"], int(app.config["MONGO_DB_PORT"]))
	
@app.teardown_request
def close_conn(exception):
	g.mongo_client.close()

@app.route("/")
def index():
	return render_template("index.html")

if __name__ == "__main__":
	app.run()